﻿@model IEnumerable<AspDotNet.Framework.Mvc.FirstDemo.Models.Person>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.age)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.address)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.phone)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.email)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.professional)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.idCard)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.bankCard)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.profile)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.age)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.address)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.phone)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.email)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.professional)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.idCard)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.bankCard)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.profile)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.id }) |
            @Html.ActionLink("Details", "Details", new { id=item.id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.id })
        </td>
    </tr>
}

</table>
